﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class giao_dien_searchproduct : System.Web.UI.Page
{
    ProductBus productBus = new ProductBus();
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        string idsearch = txtSearch.Text;
        if (idsearch.Equals(""))
        {
            Response.Write("Not empty");

        }
        else                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
        {
            DataTable dt = productBus.GetProductDetailById(idsearch);

            gridviewAllProduct.DataSource = dt;
            gridviewAllProduct.DataBind();
            
        }
    }
    protected void btnDisplay_Click(object sender, EventArgs e)
    {
        DataTable dt = productBus.GetAllProduct();

        gridviewAllProduct.DataSource = dt;
        gridviewAllProduct.DataBind();
    }
   
}